Skip to content

chore(preconf): enrich sequencer server health check impl.#3086

Open
bar-bera wants to merge 12 commits into
preconf-devfrom
preconf/sequencer-health-check
Open

chore(preconf): enrich sequencer server health check impl.#3086
bar-bera wants to merge 12 commits into
preconf-devfrom
preconf/sequencer-health-check

Conversation

@bar-bera
Copy link
Copy Markdown
Collaborator

Uses existent services to add checks on the /eth/v1/preconf/health endpoint of the sequencer server:

  • node has a state to work with
  • node is synced
  • EL is connected

@bar-bera bar-bera requested a review from a team as a code owner April 20, 2026 15:36
Copilot AI review requested due to automatic review settings April 20, 2026 15:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enriches the sequencer preconf server /eth/v1/preconf/health endpoint by reporting readiness/sync state and execution-layer connectivity, wiring in existing node services to drive those checks.

Changes:

  • Extend preconf.Server to accept SyncChecker and ELChecker dependencies and use them in the health handler to return 200 vs 503 plus a JSON body.
  • Wire ConsensusService and EngineClient into the sequencer preconf server provider.
  • Add HealthResponse type and new unit tests covering the health endpoint status/flags.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
node-core/components/preconf_server.go Injects consensus + engine clients into the preconf server so health checks can reflect node/EL state.
beacon/preconf/types.go Adds HealthResponse struct returned by /eth/v1/preconf/health.
beacon/preconf/server.go Implements health response building and 200/503 logic based on readiness, syncing, and EL connectivity.
beacon/preconf/server_test.go Updates server construction for new deps and adds coverage for the health endpoint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread beacon/preconf/server.go
Comment thread beacon/preconf/server_test.go
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 83.78378% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.22%. Comparing base (322b102) to head (ec21af0).

Files with missing lines Patch % Lines
beacon/preconf/server.go 87.50% 2 Missing and 1 partial ⚠️
node-core/components/preconf_server.go 0.00% 2 Missing ⚠️
execution/client/client.go 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           preconf-dev    #3086      +/-   ##
===============================================
+ Coverage        58.82%   59.22%   +0.40%     
===============================================
  Files              381      381              
  Lines            19687    19714      +27     
===============================================
+ Hits             11581    11676      +95     
+ Misses            7138     7067      -71     
- Partials           968      971       +3     
Files with missing lines Coverage Δ
beacon/preconf/types.go 51.72% <ø> (ø)
execution/client/engine.go 62.37% <100.00%> (+1.15%) ⬆️
execution/client/errors.go 30.76% <100.00%> (+2.76%) ⬆️
execution/client/client.go 54.61% <80.00%> (+0.13%) ⬆️
node-core/components/preconf_server.go 21.05% <0.00%> (-1.17%) ⬇️
beacon/preconf/server.go 57.14% <87.50%> (+4.56%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@calbera calbera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit but mostly looks good

Comment thread beacon/preconf/server.go
resp := new(HealthResponse)

if s.syncChecker != nil {
resp.IsReady = s.syncChecker.IsAppReady() == nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsAppReady should return a boolean (in general any func thats named Is<something> should return bool) since the error value is never used.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree it's a bit weird but this is just the ConsensusService relaying the comet interface. I would avoid to wrap it with an extra layer

Copy link
Copy Markdown
Contributor

@calbera calbera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, once e2e passes

Comment thread beacon/preconf/server.go Outdated
Comment on lines +66 to +67
// IsAppReady returns nil if the node has committed at least one block.
IsAppReady() error
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: to make it clear from reading this code, we can add a quick comment here explaining:

  • why/how we use the error
  • why its not overriden (bc its part of the comet service already)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants